/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.route.system.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author neco
 */
@Entity
@Table(name = "rps_route_payment_detail",  schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RpsRoutePaymentDetail.findAll", query = "SELECT r FROM RpsRoutePaymentDetail r"),
    @NamedQuery(name = "RpsRoutePaymentDetail.findByDetailId", query = "SELECT r FROM RpsRoutePaymentDetail r WHERE r.detailId = :detailId")})
public class RpsRoutePaymentDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "detail_id", nullable = false)
    private Integer detailId;
    @JoinColumn(name = "detail_payment_type", referencedColumnName = "type_id")
    @ManyToOne
    private RpsRoutePaymentType detailPaymentType;
    @JoinColumn(name = "detail_route_description", referencedColumnName = "description_id")
    @ManyToOne
    private RpsRouteDescription detailRouteDescription;
    @JoinColumn(name = "detail_payment", referencedColumnName = "payment_id")
    @ManyToOne
    private RpsPayment detailPayment;

    public RpsRoutePaymentDetail() {
    }

    public RpsRoutePaymentDetail(Integer detailId) {
        this.detailId = detailId;
    }

    public Integer getDetailId() {
        return detailId;
    }

    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }

    public RpsRoutePaymentType getDetailPaymentType() {
        return detailPaymentType;
    }

    public void setDetailPaymentType(RpsRoutePaymentType detailPaymentType) {
        this.detailPaymentType = detailPaymentType;
    }

    public RpsRouteDescription getDetailRouteDescription() {
        return detailRouteDescription;
    }

    public void setDetailRouteDescription(RpsRouteDescription detailRouteDescription) {
        this.detailRouteDescription = detailRouteDescription;
    }

    public RpsPayment getDetailPayment() {
        return detailPayment;
    }

    public void setDetailPayment(RpsPayment detailPayment) {
        this.detailPayment = detailPayment;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (detailId != null ? detailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RpsRoutePaymentDetail)) {
            return false;
        }
        RpsRoutePaymentDetail other = (RpsRoutePaymentDetail) object;
        if ((this.detailId == null && other.detailId != null) || (this.detailId != null && !this.detailId.equals(other.detailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.route.system.entity.RpsRoutePaymentDetail[ detailId=" + detailId + " ]";
    }
    
}
